<template>
	<view>

		<view class="home" v-if="false" style="position:fixed;" :style="{ top: top + 'px'}" id="right-nav"
			@touchmove.stop.prevent="setTouchMove">

			<view class="homeCon bg-color-red" :class="homeActive === true ? 'on' : ''" v-if="homeActive">
				<!-- 85616855623 -->

				<navigator v-for="(item,index) in myTool" hover-class='none' :url='item.url' open-type='reLaunch'>
					<view class=""
						style="color: #fff;width: 120rpx;display: flex;height: 120rpx;flex-direction: column;align-items: center;">
						<image style="width: 60rpx;height: 60rpx;" :src="item.pic" mode="">
						</image>
						{{item.name}}
					</view>

				</navigator>


			</view>
		
			<view @click="open" class="pictrueBox">
				<view class="pictrue">
					<image :src="
              homeActive === true
                ? 'https://gfry.oss-cn-hangzhou.aliyuncs.com/crmebimage/public/content/2024/03/07/kjcd.png'
                : 'https://gfry.oss-cn-hangzhou.aliyuncs.com/crmebimage/public/content/2024/03/07/kjcd.png'
            " class="image" />
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getIndexData,

	} from '@/api/api.js';
	import {
		HTTP_ADMIN_URL,
		HTTP_REQUEST_URL,
		HEADER,
		TOKENNAME,
		HEADERPARAMS
	} from '@/config/app';
	import {
		mapGetters
	} from "vuex";
	export default {
		name: "Home",
		props: {},

		data() {
			return {
				comApi: "",
				myTool: [

				],

				top: "500"
			}

		},
		mounted() {
			this.myTool = uni.getStorageSync('menus')

		},

		computed: mapGetters(["homeActive"]),
		methods: {
			setTouchMove(e) {
				var that = this;
				if (e.touches[0].clientY < 700 && e.touches[0].clientY > 66) {
					that.top = e.touches[0].clientY
					
					// that.setData({
					// 	top: e.touches[0].clientY
					// })
				}
			},
			open: function() {
				this.homeActive ?
					this.$store.commit("CLOSE_HOME") :
					this.$store.commit("OPEN_HOME");
			}
		},

		created() {
			this.comApi = HTTP_ADMIN_URL
		}
	};
</script>

<style scoped lang="scss">
	.order-bd {
		display: flex;
		align-items: center;

		flex-wrap: wrap;
		justify-content: flex-start !important;

		/* 左对齐*/
		.order-item {

			width: 20%;
			text-align: center;
			margin: 20rpx 0;


			// margin: 20rpx auto;
			// width: 20%;
			// display: flex;
			// flex-direction: column;
			// // justify-content: center;
			// align-items: center;

			.pic {
				position: relative;
				// text-align: center;

				image {
					width: 48rpx;
					height: 48rpx;
				}
			}

			.txt {
				height: 80rpx;
				margin-top: 15rpx;
				font-size: 23rpx;
				color: #454545;
			}
		}
	}

	.pictrueBox {
		width: 130rpx;
		height: 120rpx;
	}

	/*返回主页按钮*/
	.home {
		position: fixed;
		color: white;
		text-align: center;
		z-index: 9999;
		right: 15rpx;
		display: flex;
	}

	.home .homeCon {
		border-radius: 50rpx;
		opacity: 0;
		// height: 0;
		color: $theme-color;
		// width: 0;
	}

	.home .homeCon.on {
		opacity: 1;
		animation: bounceInRight 0.5s cubic-bezier(0.215, 0.610, 0.355, 1.000);
		// width: 300rpx;
		// height: 86rpx;
		margin-bottom: 20rpx;
		display: flex;
		flex-wrap: wrap;
		padding: 20rpx;
		// justify-content: center;
		align-items: center;

		background: $maincolor !important;
	}

	.home .homeCon .iconfont {
		font-size: 48rpx;
		color: #fff;
		display: inline-block;
		margin: 0 auto;
	}

	.home .pictrue {
		width: 86rpx;
		height: 86rpx;
		border-radius: 50%;
		margin: 0 auto;
	}

	.home .pictrue .image {
		width: 100%;
		height: 100%;
		border-radius: 50%;
		/* 	transform: rotate(90deg);
		ms-transform: rotate(90deg);
		moz-transform: rotate(90deg);
		webkit-transform: rotate(90deg);
		o-transform: rotate(90deg); */
	}
</style>